Skip to main content

All Questions

3votes
2answers
76views

Persist relation to a class (and not a class instance) in Ruby on Rails with Mongoid

Assume my users can subscribe to several plan_types. I want to define those plans as classes, and be able to keep, for each user, a reference to a subscription_plan and also a presubscription_plan. ...
Cyril Duchon-Doris's user avatar
0votes
1answer
124views

List User Online Status

I'm using Rails with MongoDB for database. In my apps I have 1 action for displaying list of users. User has name, image, ...
itx's user avatar
  • 269
2votes
0answers
483views

Scoping through embedded document in MongoId

I'm using MongoId in a Rails project. I need to select some products which contain some SKUs which has an embedded document. The models are respectively Product and ...
Laurent's user avatar
1vote
2answers
2kviews

Finding mongodb records in batches using mongoid [closed]

I want to get records in batches. But mongoid doc says to avoid using skip due as it can be expensive. I wrote this method to iterate through a large number records efficiently. ...
tessie's user avatar
3votes
1answer
75views

Probability ordering by seller's tariff

I have an instance method which calculates the position of an element, depending on the tariff of its seller. If the seller is of a level3 tariff, it gets to top ...
schumi's user avatar

close